package com.hrsoft.edi.stub;

import com.hrsoft.edi.stub.consant.AppInfo;
import com.hrsoft.edi.stub.request.OrderCancelRequest;
import com.qimen.api.DefaultQimenClient;
import com.qimen.api.QimenClient;
import com.qimen.api.response.OrderCancelResponse;
import com.taobao.api.ApiException;
/**
 * @ClassName StockOutCreateTest
 * @Author liuxin
 * @Date 2019/7/30 16:58
 * @Description
 */
public class OrderCancelTest {

    public static void create()
            throws ApiException
    {
        QimenClient client = new DefaultQimenClient(AppInfo.URL, AppInfo.APP_KEY, AppInfo.SECRET);
        OrderCancelRequest orderCancelRequest = new OrderCancelRequest();
        orderCancelRequest.setCustomerId(AppInfo.CUSTOMER_ID);
        orderCancelRequest.setVersion("2.0");
        orderCancelRequest.setCancelReason("1");
        orderCancelRequest.setOrderCode("DZL2B95063904");
        orderCancelRequest.setOrderType("PTCK");
        orderCancelRequest.setOwnerCode(AppInfo.OWNER_CODE);
        orderCancelRequest.setWarehouseCode(AppInfo.WAREHOUSE_CODE);
        OrderCancelResponse response = client.execute(orderCancelRequest);
        System.out.println(response.getCode() + response.getFlag() + response.getMessage());
    }

    public static void main(String[] args)
            throws ApiException
    {
        create();
//        for (int i = 0; i < 10000; i++)
//        {
//            create();
//        }
    }
}
